<div class="pagenav">
	<a>系统设置</a> 
	<span class="pagenav-separator">/</span> 
	<a>系统状态</a>
</div>
<div class="layui-row layui-col-space20">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md6 ">
    	<div class="layui-card">
    		<div class="layui-card-header">系统概况</div>
			<div class="layui-card-body">
				<table class="layui-table">
					<tr><td width=120px>系统时间</td><td id="curtime"></td></tr>
					<tr><td >操作系统</td><td id="os_name"></td></tr>
					<tr><td >系统版本</td><td id="os_version"></td></tr>
					<tr><td >系统架构</td><td id="os_arch"></td></tr>
					<tr><td >CPU核数</td><td id="cpu_count"></td></tr>
					<tr><td >系统内存</td><td id="os_total_memory"></td></tr>
					<tr><td >可用内存</td><td id="os_free_memory"></td></tr>
				</table>
			</div>
		</div>
    </div>
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md6">
    	<div class="layui-card">
    		<div class="layui-card-header">JVM概况</div>
			<div class="layui-card-body">
				<table class="layui-table">
					<tr><td width=120px>启动时间</td><td id="start_time"></td></tr>
					<tr><td >运行时长</td><td id="run_time"></td></tr>
					<tr><td >JVM信息</td><td id="jvm_name"></td></tr>
					<tr><td >JAVA版本</td><td id="version"></td></tr>
					<tr><td >JVM占用内存</td><td id="total_memory"></td></tr>
					<tr><td >JVM空闲内存</td><td id="free_memory"></td></tr>
					<tr><td >JVM最大内存</td><td id="max_memory"></td></tr>
				</table>
			</div>
		</div>
    </div>
</div>
<script type="text/javascript">
layui.use(["admin","jquery","utils"], function(){
	var utils = layui.utils;
	var $ = layui.jquery;
	admin.ajax.get("/admin/info", null, {
		showTip : {
			ok:false,
		},
		ok:function(resp){
			var data = resp.data;
			console.log(data)
			$("#curtime").html(utils.formatDateTime(data.os.curtime, "YYYY-MM-DD HH:mm:ss"));
			$("#os_name").html(data.os.name);
			$("#os_version").html(data.os.version);
			$("#os_arch").html(data.os.arch);
			$("#cpu_count").html(data.os.cpu_count);
			$("#os_total_memory").html(data.os.total_memory);
			$("#os_free_memory").html(data.os.free_memory);
			
			$("#jvm_name").html(data.jvm.jvm_name);
			$("#version").html(data.jvm.version);
			$("#start_time").html(utils.formatDateTime(data.jvm.start_time, "YYYY-MM-DD HH:mm:ss"));
			$("#run_time").html(utils.formatSeconds(parseInt(data.jvm.run_time / 1000)));
			$("#total_memory").html(data.jvm.total_memory);
			$("#free_memory").html(data.jvm.free_memory);
			$("#max_memory").html(data.jvm.max_memory);
		}
	})
});
</script>